package Simulator;

import Shared.ERState;
import Shared.Form;
import Shared.MapPosition;

/**
 * Structure holding the emergency from the environment point of view.
 */

public class ER extends Form {

	private ERState status;

	/**
	 * Creates an emergency from the software point of view. The emergency is
	 * unassigned.
	 * 
	 * @param calleeName
	 *            The name of the person who called
	 * @param calleeNumber
	 *            The phone number of the person who called
	 * @param calleePosition
	 *            The position of the person who called
	 * @param isUrgent
	 *            True if the emergency requires an equipped ambulance.
	 * @param location
	 *            The location of the emergency
	 * @param description
	 *            The description of the emergency
	 */

	public ER(String calleeName, String calleeNumber, MapPosition calleePosition, boolean isUrgent,
			MapPosition location, String description) {
		super(calleeName, calleeNumber, calleePosition, isUrgent, location, description);

		this.status = ERState.UNASSIGNED;
	}

	/**
	 * 
	 * @return true if the emergency is unassigned, false otherwise.
	 */
	public boolean isUnAssigned() {
		return this.status == ERState.UNASSIGNED;
	}

	/**
	 * @return true if the emergency is assigned, false otherwise.
	 */
	public boolean isAssigned() {
		return this.status == ERState.ASSIGNED;
	}

	/**
	 * Set the emergency as assigned or not.
	 * 
	 * @param a
	 *            true to set the emergency as assigned, false to set it as
	 *            unassigned
	 */
	public void setAssigned(boolean a) {
		this.status = a ? ERState.ASSIGNED : ERState.UNASSIGNED;
	}

}
